emojichooser: Grab focus on map
authorMatthias Clasen <mclasen@redhat.com>
Mon, 24 Aug 2020 22:31:08 +0000 (18:31 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 24 Aug 2020 22:31:08 +0000 (18:31 -0400)
This is the right thing to do, since we have a visible
entry and want text input to go there.

gtk/gtkemojichooser.c

index 6275a088f0fbee4dfd6e831ace3aa8c0dfcc7606..62a8e19f5a9e3ddb8316653fcce9894521ea9a77 100644 (file)
@@ -999,6 +999,16 @@ keynav_failed (GtkWidget        *box,
   return FALSE;
 }
 
+static void
+gtk_emoji_chooser_map (GtkWidget *widget)
+{
+  GtkEmojiChooser *chooser = GTK_EMOJI_CHOOSER (widget);
+
+  GTK_WIDGET_CLASS (gtk_emoji_chooser_parent_class)->map (widget);
+
+  gtk_widget_grab_focus (chooser->search_entry);
+}
+
 static void
 gtk_emoji_chooser_class_init (GtkEmojiChooserClass *klass)
 {
@@ -1007,6 +1017,7 @@ gtk_emoji_chooser_class_init (GtkEmojiChooserClass *klass)
 
   object_class->finalize = gtk_emoji_chooser_finalize;
   widget_class->show = gtk_emoji_chooser_show;
+  widget_class->map = gtk_emoji_chooser_map;
 
   /**
    * GtkEmojiChooser::emoji-picked: